const useListeningFolderMove = (initInfo, FolderMoveRef) => {
  // 显示文件移动弹窗
  const showFolderMoveDialog = arr => {
    FolderMoveRef.value.showDialog(arr)
  }

  // 显示文件移动弹窗 （树结构节点右键点击）
  const resourceMoveRightClick = () => {
    initInfo.value.isContextmenuClick = true
    showFolderMoveDialog([initInfo.value.rightClickFolder])
  }

  // 显示文件移动弹窗 （选中后，全选按钮后的操作菜单点击）
  const resourceMoveMenuClick = () => {
    const activeResource: any = []
    initInfo.value.sourceList.forEach(item => {
      if (item.active) {
        activeResource.push(item)
      }
    })
    showFolderMoveDialog(activeResource)
  }

  // 文件移动弹窗关闭后，初始化部分参数
  const folderMoveDialogClose = () => {
    initInfo.value.isContextmenuClick = false
    initInfo.value.rightClickFolder = null
  }

  return {
    showFolderMoveDialog,
    resourceMoveRightClick,
    resourceMoveMenuClick,
    folderMoveDialogClose
  }
}
export default useListeningFolderMove
